//
//  MerchantAuthoriItemVM.swift
//  kxf
//
//  Created by Elavatine on 2024/10/19.
//


class MerchantAuthoriItemVM: UIView {
    
    let selfHeight = kFitWidth(56)
    
    var copyBlock:(()->())?
    
    override init(frame:CGRect){
        super.init(frame: CGRect.init(x: 0, y: frame.origin.y, width: SCREEN_WIDHT, height: selfHeight))
        self.backgroundColor = .white
        self.isUserInteractionEnabled = true
        
        initUI()
    }
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    lazy var leftTitleLabel: UILabel = {
        let lab = UILabel()
        lab.textColor = .black
        lab.font = .systemFont(ofSize: 14, weight: .medium)
        
        return lab
    }()
    lazy var detailLabel: UILabel = {
        let lab = UILabel()
        lab.textColor = .black
        lab.font = .systemFont(ofSize: 14, weight: .medium)
        
        return lab
    }()
    lazy var lineView: UIView = {
        let vi = UIView()
        vi.backgroundColor = .COLOR_LIGHT_GREY
        return vi
    }()
}

extension MerchantAuthoriItemVM{
    func updateUI(dict:NSDictionary) {
        
    }
}

extension MerchantAuthoriItemVM{
    func initUI() {
        addSubview(leftTitleLabel)
        addSubview(detailLabel)
        addSubview(lineView)
        
        setConstrait()
    }
    func setConstrait() {
        leftTitleLabel.snp.makeConstraints { make in
            make.left.equalTo(kFitWidth(24))
            make.centerY.lessThanOrEqualToSuperview()
        }
        detailLabel.snp.makeConstraints { make in
//            make.left.equalTo(kFitWidth(120))
            make.right.equalTo(kFitWidth(-20))
            make.centerY.lessThanOrEqualToSuperview()
        }
        lineView.snp.makeConstraints { make in
            make.left.bottom.width.equalToSuperview()
            make.height.equalTo(kFitWidth(1))
        }
    }
}
